package com.yilian.xlmusic.android.view.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;
import com.yilian.xlmusic.android.R;
import com.yilian.xlmusic.android.databinding.CategoryAdapterItemBinding;
import com.yilian.xlmusic.android.view.bean.ImageLoader;
import com.yilian.xlmusic.android.view.bean.MusicCategoryBean;

import org.jetbrains.annotations.NotNull;
public class MCategoryAdapter extends BaseQuickAdapter<MusicCategoryBean, BaseDataBindingHolder<CategoryAdapterItemBinding>> {
    public MCategoryAdapter() {
        super(R.layout.category_adapter_item);
    }

    @Override
    protected void convert(@NotNull BaseDataBindingHolder<CategoryAdapterItemBinding> baseViewHolder, MusicCategoryBean musicCategoryBean) {
        CategoryAdapterItemBinding binding= baseViewHolder.getDataBinding();
        if(binding!=null){
            binding.setMusicCategoryBean(musicCategoryBean);
            //图片下载
            ImageLoader.bindImageUrl(binding.imgLeft,musicCategoryBean.getCover());
        }
    }
}
